// Activity.cpp: implementation of the Activity class.
//
//////////////////////////////////////////////////////////////////////

#include "Activity.h"
#include "data.h"


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////


Activity::Activity(data md, int job, int stage)
{

	_job     = job;
	_stage   = stage;
	_machine = md.getMachines(job, stage);
	_stime   = md.getStimes(job, stage);
	_ptime   = md.getPtimes(job,stage);
	_etime   = md.getEtimes(job,stage);


}

Activity::Activity(schedule ms, int job, int stage)
{

	_job     = job;
	_stage   = stage;
	_machine = ms.getMachines(job, stage);
	_stime   = ms.getStimes(job, stage);
	_ptime   = ms.getPtimes(job,stage);
	_etime   = ms.getEtimes(job,stage);
}



Activity::setPtime(int job, int stage,int ptime)
{
	_job	= job;
	_stage	= stage;
	_ptime	= ptime;
	return 0;
}


Activity::setStime(int job, int stage,int stime)
{
	_job	= job;
	_stage	= stage;
	_stime	= stime;
	return 0;
}

Activity::setStime(int job, int stage, int machine, int stime)
{
	_job	= job;
	_stage	= stage;
	_machine = machine;
	_stime	= stime;
	return 0;
}

Activity::setEStime(int job, int stage,int estime)
{
	_job	= job;
	_stage	= stage;
	_estime	= estime;
	return 0;
}

Activity::setLStime(int job, int stage,int lstime)
{
	_job	= job;
	_stage	= stage;
	_lstime	= lstime;
	return 0;
}

Activity::getStime(int job, int stage)
{
	_job	= job;
	_stage	= stage;
	return _stime ;
}

Activity::getLStime(int job, int stage)
{
	_job	= job;
	_stage	= stage;
	return _lstime ;
}

Activity::getEStime(int job, int stage)
{
	_job	= job;
	_stage	= stage;
	return _estime ;
}

Activity::getStime(int job, int stage, int machine)
{
	_job	= job;
	_stage	= stage;
	_machine = machine;
	return _stime;
}

Activity::getPtime(int job, int stage)
{
	_job	= job;
	_stage	= stage;
	return _ptime ;
}

Activity::getEtime(int job, int stage)
{
	_job	= job;
	_stage	= stage;

	return _stime + _ptime;
}

Activity::setRtime(int job, int stage, int rtime) 
{
	_job   = job;
	_stage = stage;
	_rtime = rtime;
	return 0;
}

Activity::getRtime(int job, int stage)
{
	_job	= job;
	_stage	= stage;
	return	_rtime;
}

Activity::setMachine ( int job, int stage, int machine)
{
	_job		= job;
	_stage		= stage;
	_machine	= machine;
	return 0;
}
Activity::getMachine ( int job, int stage)
{
	_job		= job;
	_stage		= stage;
	return		_machine;
}








